<?php
$task = $game->rw_player_get_info($arr_data->rwid);
$task_sys = $game->rw_get_sys($arr_data->rwid);
$player = $game->player_get_uinfo();
$gonowmid = $game->create_url_nowmid();
$rwdjarr = explode(',',$task->rwdj);
$rwjlhtml = '任务奖励：<br/>';
$rwhtml='';

if ($task->rwdj!=''){
    for ($i= 0; $i<count($rwdjarr); $i++){

        $djarr = explode('|',$rwdjarr[$i]);
        $djid = $djarr[0];
        $djcount = $djarr[1];
        $rwdj = $game->dj_get_sys($djid);
        $djinfo = $game->create_url("cmd=djinfo&djid=$rwdj->djid",$rwdj->djname);
        $rwjlhtml .="<div class='djys'>{$djinfo}x{$djcount}</div>";
    }
}


if ($task->rwzb!=''){

    $ret = $game->zb_get_info_rw_all($arr_data->rwid);
    for ($i=0;$i<count($ret);$i++){
        $zbname = $ret[$i]->zbname;
        $zbid = $ret[$i]->zbid;
        $zbcmd = $game->create_url("cmd=zbinfo_sys&cmd2=zbinfo_sys&zbid=$zbid",$zbname);
        $rwjlhtml.="<div class='zbys'>$zbcmd</div>";
    }
}
if ($task->rwexp!=''){
    $rwjlhtml.="经验：$task->rwexp<br/>";
}
if ($task->rwyxb!=''){
    $rwjlhtml.="灵石：$task->rwyxb<br/>";
}

switch ($task->rwzl){
    case 1://收集
        $daoju = $game->dj_get_player($task->rwyq);
        $rwyq = $game->dj_get_sys($task->rwyq);
        $rwhtml ="收集{$task->rwcount}{$rwyq->djname}<br/>进度：{$task->rwnowcount}/$task->rwcount";
        break;

    case 2://打怪

        $guaiwu = $game->gw_get_info_sys($task->rwyq);
        $gwmap = $game->gw_get_mid($guaiwu->id);
        $pvemap = '';
        foreach ($gwmap as $map){
            $qy = $game->mid_get_qy($map->mqy);
            $pvemap .= "[$qy->qyname -> $map->mname]";
        }

        $rwhtml ="击杀$task->rwcount$guaiwu->gname($pvemap)<br/>进度：$task->rwnowcount/$task->rwcount";

        break;

}

$cfnpc = $game->npc_get_info($task->chufa);
$tjnpc = $game->npc_get_info($task->tijiao);
$rwhtml .="<br/>触发：{$cfnpc->nname}<br/>提交：{$tjnpc->nname}";

$taskinfo = "
{$task->rwname}:<br/>
{$task_sys->rwinfo}<br/>
{$rwhtml}<br/><br/>
{$rwjlhtml}
<br/>
{$gonowmid}
";
echo $taskinfo;
?>